/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.fyx.secure.web;

import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.fyx.secure.controll.SecureRoleFacadeLocal;
import org.fyx.secure.entity.SecureRole;

/**
 *
 * @author xljan
 */
@ManagedBean
@SessionScoped
public class SecureRoleMb {
    private SecureRole role = new SecureRole();
    @EJB
    private SecureRoleFacadeLocal roleController;

    public SecureRole getRole() {
        return role;
    }

    public void setRole(SecureRole role) {
        this.role = role;
    }

    /** Creates a new instance of SecureRoleMb */
    public SecureRoleMb() {
    }

    public void add(){
        roleController.create(role);
    }

    public void remove(){
        roleController.remove(role);
    }

    public List<SecureRole> getRoles(){
        return roleController.findAll();
    }

}
